package com.reservoir.file.config;

import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Minio 配置信息
 *
 * @author STARS
 */
@Configuration
public class MinioConfig {
    /**
     * 服务地址
     */
    private static final String URL ="http://118.31.15.127:9000";

    /**
     * 用户名
     */
    private static final String ACCESS_KEY = "suixintop";

    /**
     * 密码
     */
    private static final String SECRET_KEY = "suixintop";

    /**
     * 存储桶名称
     */
    private static final String BUCKET_NAME = "business";

    public String getUrl() {
        return URL;
    }


    public String getAccessKey() {
        return ACCESS_KEY;
    }


    public String getSecretKey() {
        return SECRET_KEY;
    }


    public String getBucketName() {
        return BUCKET_NAME;
    }


    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder()
                .endpoint(URL)
                .credentials(ACCESS_KEY, SECRET_KEY)
                .build();
    }
}
